package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.domain.Reply;
import cn.wolfcode.trip.base.service.IReplyService;
import cn.wolfcode.trip.base.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/replies")
public class ReplyController {
    @Autowired
    private IReplyService replyService;

    @PostMapping
    public JsonResult save(Reply reply) {
        JsonResult jsonResult = new JsonResult();
        try {
            replyService.save(reply);
        } catch (Exception e) {
            e.printStackTrace();
            jsonResult.mark("操作异常");
        }
        return jsonResult;
    }
}
